const http = require("http");
const express = require("express");
const socketIo = require("socket.io");
const app = express();
const httpServer = http.createServer(app);
const io = socketIo(httpServer);
app.use(express.static(__dirname));
io.on("connection",function(socket){
    console.log("连接成功！",socket.id);
    socket.on("one",function(a,b,c,d){
        console.log("接收到前端发送过来的数据",a,b,c,d)
    });
    setInterval(function(){
        socket.emit("two",100,200,300,400)
    },1000)
    socket.on("disconnect",function(){
        console.log("断开连接",socket.id);
    })

})
httpServer.listen(80,()=>{
    console.log("success");
})
